@import 'utils/variables';

.DataGrid {
    width: 100%;

    padding: 2rem 2rem 2rem 2rem;
    background: $bg--gray;
    color: var(--sys-center-channel-color);

    .DataGrid_search {
        height: 48px;
        background: $white;
        border-bottom: solid 1px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: row;
        font-weight: bold;
        padding: .5em 0;

        .DataGrid_searchBar {
            display: flex;
            position: relative;

            height: 32px;
            width: 300px;
            border: 1px solid rgba(var(--sys-center-channel-color-rgb), 0.2);
            box-sizing: border-box;
            border-radius: 4px;

            margin-left: 8px;

            input {
                border: 0px;
                margin-left: 32px;
                margin-right: 16px;
                font-size: .95em;
                width: 100%;
            }

            input:focus {
                outline: none;
            }

            .DataGrid_searchIcon {
                top: 5px;
                left: 10px;
                position: absolute;
                pointer-events: none;
                color: $dark-gray;
            }

            .DataGrid_clearButton {
                display: flex;
                align-items: center;
                margin-right: 5px;
            }
        }
    }

    .DataGrid_header {
        color: rgba(0, 0, 0, 0.87);
        border-bottom: solid 1px rgba(0, 0, 0, 0.1);
        display: flex;
        flex-direction: row;
        font-size: 1.1em;
        font-weight: bold;
        padding: .5em 0;
    }

    .DataGrid_rows {
        display: flex;
        flex-direction: column;
        background: rgba(var(--sys-button-color-rgb), 0.5);

        .DataGrid_loading {
            margin: auto;
            font-size: 1.6rem;
            color: rgba(0, 0, 0, 0.3);
            padding-top: 20px;
            padding-bottom: 20px;
        }

        .DataGrid_empty {
            font-size: 1.6rem;
            width: 100%;
            padding-top: 20px;
            padding-bottom: 20px;
            color: rgba(0, 0, 0, 0.3);
            text-align: center;
        }

        .DataGrid_row {
            border-left: 2px solid transparent;

            &:nth-child(odd) {
                background-color: $bg--gray;
            }

            &:hover {
                background-color: lighten($primary-color, 45%);
                border-left: 2px solid $primary-color;
            }

            .DataGrid_cell {
                margin: auto;
                text-overflow: ellipsis;
                overflow: hidden;
                white-space: nowrap;
            }
        }
    }

    .DataGrid_row, .DataGrid_header {
        display: flex;
        flex-direction: row;
        padding-left: 18px;
        height: auto;

        .DataGrid_cell {
            flex-basis: 100%;
            flex: 1 0;
        }
    }

    .DataGrid_footer {
        display: flex;
        flex-direction: row;
        height: auto;

        text-align: right;
        background: $white;
        border-top: solid 1px rgba(0, 0, 0, 0.1);
        border-bottom: solid 1px rgba(0, 0, 0, 0.1);
        padding: 5px 0;

        color: rgba(0, 0, 0, 0.5);
        font-size: 1.1em;

        .DataGrid_cell {
            width: 100%;
            text-align: right;
        }
    }
}
